namespace ConsoleApp2.input._0925;
public class Demo
{
    enum Weekday
    {
        Monday = 1,
        Tuesday,
        Wednesday,
        Thursday,
        Friday,
        Saturday,
        Sunday
    }
    private string name ;

    public Demo()
    {
        this.name = "Demo";
    }

    public void TestPrint()
    {
        Console.WriteLine(name);
    }

    public void TestPrint2()
    {
        Console.WriteLine("请输入一个三位数：");
        int  input;
        input = Convert.ToInt32(Console.ReadLine());
        Console.WriteLine(input/100);
        Console.WriteLine(input/10%10);
        Console.WriteLine(input%10);
    }

    public void TestPrint3()
    {
        bool flag;
        Console.WriteLine("请输入一个年份：");
        int year = Convert.ToInt32(Console.ReadLine());
        flag = (year % 4 == 0)&& (year % 100 != 0) || (year % 400 == 0)? true : false;
        if (flag)
        {
            Console.WriteLine("{0}是闰年", year);
        }
        else
        {
            Console.WriteLine("{0}不是闰年", year);
        }
    }

    public void TestPrint4()
    {
        const int price = 8800;//private修饰成员变量不是局部！
        Console.WriteLine("请输入出行季节月份：");
        int month = Convert.ToInt32(Console.ReadLine());
        if (month >= 5 && month <= 10)
        {
            Console.WriteLine("选乘：1.飞机 2.动车");
            int option = Convert.ToInt32(Console.ReadLine());
            if (option == 1)
            {
                Console.WriteLine("机票价格：{0}", price * 0.8);
            }
            else if (option == 2)
            {
                Console.WriteLine("动车的价格：{0}",price*0.75);
            }
            else
            {
                Console.WriteLine("请重新输入!");
            }
        }
        else if (month<=4&&month>=1||month>=11&&month<=12)
        {
            Console.WriteLine("选乘：1.飞机 2.动车");
            int option = Convert.ToInt32(Console.ReadLine());
            if (option == 1)
            {
                Console.WriteLine("机票价格：{0}", price * 0.6);
            }
            else if (option == 2)
            {
                Console.WriteLine("动车的价格：{0}",price*0.3);
            }
            else
            {
                Console.WriteLine("请重新输入!");
            }
        }
        else
        {
            Console.WriteLine("请重新输入！");
        }
    }

    public void TestPrint5()
    {
        Weekday weekday;
        int a = (int)Weekday.Friday;
        int b =  (int)Weekday.Sunday;
        Console.WriteLine("Friday{0}",a);
        Console.WriteLine("Sunday{0}",b);
    }

}